import {jsonToUrlParam} from "~/server/utils";

export default defineEventHandler(async (event) => {
    const baseUrl = useRuntimeConfig().public.serviceUrl;
    const query = (await readBody(event)) as {content:string,blogId: number,commenter: string};
    const res = await fetch(baseUrl + '/discuss/addDiscuss',{
        method: 'POST',
        body: JSON.stringify(query),
        headers:{
            'Content-Type': 'application/json'
        }
    }).then((res)=>res.json());
    // console.log(res.data)
    return res;
})